﻿<?xml version="1.0" encoding="utf-8" ?>
<layouts>
  <!-- Map header (minus version info) -->
  <layout for="header">
		<uint32 name="file size" offset="0x8" />
		<uint32 name="index header address" offset="0x10" />
		<uint32 name="virtual size" offset="0x18" />
		<int16 name="type" offset="0x13C" />

    <int32 name="string table count" offset="0x158" />
    <int32 name="string table size" offset="0x15C" />
    <int32 name="string index table offset" offset="0x160" />
    <int32 name="string table offset" offset="0x164" />

    <asciiz name="internal name" offset="0x18C" />
    <asciiz name="scenario name" offset="0x1B0" />

    <int32 name="file table count" offset="0x2B4" />
    <int32 name="file table offset" offset="0x2B8" />
    <int32 name="file table size" offset="0x2BC" />
    <int32 name="file index table offset" offset="0x2C0" />
    
		<uint32 name="virtual base address" offset="0x2F8" />
		<uint32 name="xdk version" offset="0x2FC" />
		<array name="partitions" offset="0x300" count="6" entrySize="0x8">
			<uint32 name="load address" offset="0x0" />
			<uint32 name="size" offset="0x4" />
		</array>
		<uint32 name="raw table offset" offset="0x480" />
		<uint32 name="locale offset magic" offset="0x488" />
    <uint32 name="string offset magic" offset="0x48C" />
		<uint32 name="raw table size" offset="0x498" />
		<uint32 name="virtual size" offset="0x4A0" />
	</layout>
  
  <!-- Index table header -->
  <layout for="index header">
    <int32 name="number of classes" offset="0x0" />
    <uint32 name="class table address" offset="0x4" />
    <int32 name="number of tags" offset="0x8" />
    <uint32 name="tag table address" offset="0xC" />
    <int32 name="number of important classes" offset="0x10" />
    <uint32 name="important class table address" offset="0x14" />
    <int32 name="magic" offset="0x28" />
  </layout>
  
  <!-- Class table entry -->
  <layout for="class entry">
    <int32 name="magic" offset="0x0" />
    <int32 name="parent magic" offset="0x4" />
    <int32 name="grandparent magic" offset="0x8" />
    <uint32 name="identifier" offset="0xC" />
  </layout>
  
  <!-- Tag table entry -->
  <layout for="tag entry">
    <int16 name="class index" offset="0x0" />
    <uint16 name="datum index salt" offset="0x2" />
    <uint32 name="memory address" offset="0x4"/>
  </layout>

  <layout for="matg">
    <array name="languages" offset="0x2BC" entrySize="0x44" count="12">
      <uint32 name="string count" offset="0x0" />
      <uint32 name="locale table size" offset="0x4" />
      <uint32 name="locale index table offset" offset="0x8" />
      <uint32 name="locale data index offset" offset="0xC" />
    </array>
  </layout>

  <layout for="locale index table entry">
    <uint32 name="unknown" offset="0x0" />
    <uint32 name="offset" offset="0x4" />
  </layout>
</layouts>